/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pfc.modeloer;

import org.apache.ddlutils.model.Reference;



/**
 *
 * @author xandru
 */
public class ERReference {

        EREntity sourceEntity;
        EREntity targetEntity;
        ERAttrib sourceAttrib;
        ERAttrib targetAttrib;


        private String sourceEntityName;
        private String targetEntityName;
        private String sourceAttribName;
        private String targetAttribName;

    public ERReference(EREntity sourceEntity, EREntity targetEntity, ERAttrib sourceAttrib, ERAttrib targetAttrib) {
        this.sourceEntity = sourceEntity;
        this.targetEntity = targetEntity;
        this.sourceAttrib = sourceAttrib;
        this.targetAttrib = targetAttrib;
    }

    public ERAttrib getSourceAttrib() {
        return sourceAttrib;
    }

    public void setSourceAttrib(ERAttrib sourceAttrib) {
        this.sourceAttrib = sourceAttrib;
    }

    public EREntity getSourceEntity() {
        return sourceEntity;
    }

    public void setSourceEntity(EREntity sourceEntity) {
        this.sourceEntity = sourceEntity;
    }

    public ERAttrib getTargetAttrib() {
        return targetAttrib;
    }

    public void setTargetAttrib(ERAttrib targetAttrib) {
        this.targetAttrib = targetAttrib;
    }

    public EREntity getTargetEntity() {
        return targetEntity;
    }

    public void setTargetEntity(EREntity targetEntity) {
        this.targetEntity = targetEntity;
    }

    public String getSourceAttribName() {
        return sourceAttrib.getName();
    }

    public String getSourceEntityName() {
        return sourceEntity.getName();
    }

    public String getTargetAttribName() {
        return targetAttrib.getName();
    }

    public String getTargetEntityName() {
        return targetEntity.getName();
    }

    public void setSourceAttribName(String sourceAttribName) {
        throw new UnsupportedOperationException("Este metodo no debe usarse");
    }

    public void setSourceEntityName(String sourceEntityName) {
        throw new UnsupportedOperationException("Este metodo no debe usarse");
    }

    public void setTargetAttribName(String targetAttribName) {
        throw new UnsupportedOperationException("Este metodo no debe usarse");
    }

    public void setTargetEntityName(String targetEntityName) {
        throw new UnsupportedOperationException("Este metodo no debe usarse");
    }

    public String toString()
    {
        return("[" + getSourceEntityName() + "." + getSourceAttribName() + "] -> [" + getTargetEntityName() + "." + getTargetAttribName() + "]");
    }






        
    }
